fix(specifiers): withhold all generated definitions pending clinician review#691
Conversation
… review Follow-up to the DSM-5-TR specifier catalogue (#656). Automated review repeatedly surfaced clinically wrong auto-generated text among the rows whose SOURCE was verified (gaming subtypes, PTSD/Conduct threshold notes, AMPD provenance, BED severity notes, possession meanings, ...). "Source verified" only attests the specifier's existence/attribution, not that the generated definition text is clinically correct, so displaying any of it as trusted is unsafe for a decision-support tool. Withhold the generated meaning/clinical-note for ALL catalogue rows — not just the previously-ungated ~514 — until a clinician authors real definitions: - specifier-reference-page.tsx: every catalogue detail page now shows the "definition pending qualified clinician verification" notice instead of generated meaning/clinical-note. Structural facts (label, disorder, group, ICD-11 context), the source/review badges, and the hand-authored curated fit/exclusion guidance are still shown. - specifiers-search-index.json: blank all 71 remaining meaning fields so no generated definition text is displayed or ranked on client-side. - tests: assert the client index carries no generated definition text. The full 585-item catalogue, search, routing, provenance badges, and structure are unchanged. The nested content dataset is left intact so a future clinician-reviewed regeneration can restore verified definitions. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR revises ARFID ICD-11 wording, removes generated meaning text from the compact specifier index, changes reference-page verification gating, and updates tests for the new content behavior. ChangesSpecifier definition updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Source verification against ICD-11 6B83 found the ARFID feature labelled
"With inadequate food intake associated with limited availability" names an
ICD-11 EXCLUSION ("unavailability of food") rather than a driver. The genuine
third ARFID driver — alongside sensory-based avoidance and fear of aversive
consequences — is an apparent lack of interest in eating / low appetite.
Relabel it accordingly in the content dataset and the client index (rowKey/slug
kept stable to avoid breaking URLs), and add a regression test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/specifiers/specifier-reference-page.tsx`:
- Line 133: Update the unlabeled-item message in the specifier reference
rendering branch to avoid hardcoding DSM-5-TR. Reuse the existing “DSM-5-TR /
ICD-11” source-neutral wording, or derive the correct manual from sourceManual,
while preserving the current item.label and item.disorderName details.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7cc63fd4-018a-405c-8f5f-c25e0c94ed8c
📒 Files selected for processing (4)
data/specifiers-content.jsondata/specifiers-search-index.jsonsrc/components/specifiers/specifier-reference-page.tsxtests/specifiers-content.test.ts
CodeRabbit: the "no separate definition" branch of the reference-page description hardcoded "DSM-5-TR", so an ICD-11 item without a definition told users to read it against the wrong manual. Use the per-item sourceManual label (DSM-5-TR or ICD-11) already derived for the badge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
Summary
Follow-up to the DSM-5-TR specifier catalogue (#656). During that PR's review, automated reviewers repeatedly surfaced clinically wrong auto-generated text on rows whose source was "verified" — gaming online/offline subtypes, PTSD/Conduct threshold notes, AMPD provenance, BED severity notes, "with/without possession" meanings, and more. Each was corrected individually, but the pattern showed that
source-verifiedonly attests the specifier's existence/attribution — not that the generated definition text is clinically correct. For a decision-support tool, displaying any of that text as trusted is unsafe.This change withholds the generated definition text on every catalogue row (not just the ~514 already gated), pending clinician-authored definitions:
specifier-reference-page.tsx: every catalogue detail page now shows the "definition pending qualified clinician verification" notice instead of the generated meaning/clinical-note. Still shown: the specifier's structural facts (label, disorder, group, ICD-11 context), the source/review-status badges, and the hand-authored curated fit/exclusion guidance for the 14 curated mood specifiers.data/specifiers-search-index.json: the 71 remainingmeaningfields are blanked, so no generated definition text is displayed or ranked on client-side.tests/specifiers-content.test.ts: asserts the client index carries no generated definition text.Unchanged: the full 585-item catalogue, search, routing, provenance badges, and structure. The nested content dataset (
data/specifiers-content.json) is left intact so a future clinician-reviewed regeneration can restore verified definitions without re-importing.Verification
Run in-sandbox (CI runs the full gates):
Next.js production build compiled successfully; no type errors in any changed
src/file (the onlytscfailures are the pre-existing uninstalled test deps@testing-library/*/@axe-core/playwright).ESLint + Prettier clean on all changed files.
Vitest:
tests/specifiers-content.test.ts+tests/specifiers.test.ts→ 27/27 pass; the client index now exposes 0 generated definitions.npm run verify:pr-localnpm run verify:ui— detail/search copy changed; worth a Chromium passnpm run check:production-readiness— clinical output/source-governance surface changedClinical Governance Preflight
Clinical KB Database/sjrfecxgysukkwxsowpy) — no Supabase changes.Notes
🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit